package com.hospital.demo.controller.dingyuxin;

import com.hospital.demo.model.dingyuxin.Expend;
import com.hospital.demo.service.dingyuxin.DocterSer;
import com.hospital.demo.util.ResultUtils;
import com.hospital.demo.util.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dyx_doctor")
@Api(tags={"DYX_医生接口"})
public class DoctorCon {

    @Autowired
    private DocterSer docterSer;

    @ApiOperation(value = "医生添加医院总余额", notes = "")
    @GetMapping(value = "/addFinance")
    private ResultVO addFinance(int finance) {
        return ResultUtils.success(docterSer.addFinance(finance));
    }

    @ApiOperation(value = "医生购买器材", notes = "")
    @PostMapping(value = "/payInstallation")
    private ResultVO payInstallation(Expend expend) {
        return ResultUtils.success(docterSer.payInstallation(expend));
    }

    @ApiOperation(value = "医生统计各项支出", notes = "")
    @GetMapping(value = "/statistics")
    private ResultVO statistics() {
        return ResultUtils.success(docterSer.statistics());
    }

    @ApiOperation(value = "显示医院总金额", notes = "")
    @GetMapping(value = "/allMoney")
    private ResultVO allMoney() {
        return ResultUtils.success(docterSer.allMoney());
    }

    @ApiOperation(value = "显示所有支出", notes = "")
    @GetMapping(value = "/allExpend")
    private ResultVO allExpend() {
        return ResultUtils.success(docterSer.allExpend());
    }

    @ApiOperation(value = "按照type显示所有支出", notes = "")
    @GetMapping(value = "/findExpendByType")
    private ResultVO findExpendByType(String type) {
        return ResultUtils.success(docterSer.findExpendByType(type));
    }
}
